using System;
namespace RpgServiceLib.Faction
{
	public class FactionLevelNameCollection:System.Collections.CollectionBase
	{
		public FactionLevelNameCollection ()
		{
		}
		
		public virtual FactionLevelNameCollection AddNew (FactionLevelName factionLevelName)
		{
			if (Count > 0) {
				FactionLevelName lastEntry = (FactionLevelName)InnerList [Count - 1];
				if (lastEntry.LevelBegin > factionLevelName.LevelBegin) {
					throw new ArgumentOutOfRangeException ("factionLevelName", "Begin-Level of new Item must be higher than Last Item Level");					
				}	 	
			}
			base.InnerList.Add (factionLevelName);
			return this;
		}
	}
}

